<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>百度一下，你就知道</title>
		<link rel="stylesheet" href="../jquery/jquery-ui.css">
		<script type="text/javascript" src="../jquery/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../jquery/jquery-ui.js"></script>
		<link rel="stylesheet"
			href="../bootstrap-3.0.0-dist/dist/css/bootstrap.css">
		<script type="text/javascript">
	$(document).ready(function() {
		$("#query").autocomplete({
			source : function(request, response) {
				$.ajax({
					url : "ajax/sug.do",
					dataType : "json",
					data : {
						query : $("#query").val()
					},
					success : function(data) {
						response($.map(data.result, function(item) {
							return {value:item};
						}));
					}
				});
			},
			minLenth : 1
		});
	});
</script>
	</head>
	<body>
		<div class="container">
			<h1>
				Search
			</h1>
			<input id="query" />
		</div>

	</body>
</html>